﻿using System;
/*Write a program that finds the maximal sequence of equal elements in an array.
		Example: {2, 1, 1, 2, 3, 3, 2, 2, 2, 1}  {2, 2, 2}.*/

    class MaximalSequence
    {
        static void Main()
        {
            int[] array = { 2, 1, 1, 2, 3, 3, 2, 2, 2, 2, 2, 1 };
            int maxLenght = 1;
            int currLenght = 1;

            for (int i = 0; i < array.Length-1; i++)
            {
                if (array[i] == array[i + 1])
                {
                    currLenght++;
                    if (currLenght > maxLenght)
                    {
                        maxLenght = currLenght;

                    }
                }
                else 
                {
                    currLenght = 1;
                }

            }
            Console.WriteLine(maxLenght);
        }
    }

